package com.equity.authentication;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.equity.authentication.service.ISLogin;

@Component("loginBean")
public class LoginBean {

	private String user;
	private String password;

	@Autowired
	private ISLogin loginService;

	public String doLogin() {
		String page = "error";
		try {
			if (loginService.tx_doLogin(user, password)) {
				page = "success";
			}
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return page;
	}

	public String getUser() {
		return user;
	}

	public void setUser(String user) {
		this.user = user;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

}
